<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 11] ObjectOutputStream</TITLE>
<META NAME="author" CONTENT="Mark Grand and Jonathan Knudsen">
<META NAME="date" CONTENT="Fri Aug  8 16:39:06 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java Fundamental Classes Reference">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java Fundamental Classes Reference" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch11_41.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 11<br>The java.io Package</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch11_43.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<DIV CLASS=refnamediv>
<H1>ObjectOutputStream</H1>

<H2>Name</H2>

ObjectOutputStream

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.283">Synopsis</A></h2>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Class Name:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.io.ObjectOutputStream</tt>

<p>
<DT CLASS=varlistentry>Superclass:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.io.OutputStream</tt>

<p>
<DT CLASS=varlistentry>Immediate Subclasses:<br>
<DD>

<P CLASS=para>
None

<p>
<DT CLASS=varlistentry>Interfaces Implemented:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.io.ObjectOutput</tt>

<p>
<DT CLASS=varlistentry>Availability:<br>
<DD>

<P CLASS=para>
New as of JDK 1.1 </DL>
</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.284">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>ObjectOutputStream</tt> class 
can write both primitive types and object instances to an underlying <tt CLASS=literal>OutputStream</tt>. 
The objects and other data can then be read by an <tt CLASS=literal>ObjectInputStream</tt>. 
These two classes provide persistent storage of objects when they are 
used in conjunction with <tt CLASS=literal>FileInputStream</tt> 
and <tt CLASS=literal>FileOutputStream</tt>. The classes 
can also be used with socket streams to pass objects across the network. 

<P CLASS=para>
Only objects that are instances of classes that implement the <tt CLASS=literal>Serializable</tt> 
or <tt CLASS=literal>Externalizable</tt> interfaces 
can be serialized to an output stream. The default serialization mechanism 
is implemented by <tt CLASS=literal>writeObject()</tt>. 
When an object is serialized, the class of the object is encoded, along 
with the class name, the signature of the class, the values of the non-<tt CLASS=literal>static</tt> 
and non-<tt CLASS=literal>transient</tt> fields of 
the object, including any other objects referenced by the object (except 
those that do not implement the <tt CLASS=literal>Serializable</tt> 
interface themselves). Multiple references to the same object are encoded 
using a reference sharing mechanism, so that a graph of the object can be restored 
appropriately. Strings and arrays are objects in Java, so they are treated 
as objects during serialization. 

<P CLASS=para>
For example, the following code opens a file called <I CLASS=emphasis>color.ser</I> 
and writes out a <tt CLASS=literal>Color</tt> object: 

<DIV CLASS=screen>
<P>
<PRE>
FileOutputStream fileOut;
ObjectOutputStream out;
try {
    fileOut = new FileOutputStream("color.ser");
    out = new ObjectOutputStream(fileOut);
    out.writeObject(Color.blue);
    out.close();
}
catch (IOException e) {
    System.out.println("Error writing: " + e);
}
</PRE>
</DIV>

<P CLASS=para>
Classes that require special handling during serialization and deserialization 
must implement the following methods (with these exact signatures): 

<DIV CLASS=screen>
<P>
<PRE>
private void readObject(ObjectOutputStream stream) 
             throws IOException, ClassNotFoundException
private void writeObject(ObjectOutputStream stream) throws IOException
</PRE>
</DIV>

<P CLASS=para>
The <tt CLASS=literal>writeObject()</tt> method is 
responsible for writing the state of the object for the particular class 
so that it can be restored by <tt CLASS=literal>readObject()</tt>. 
The <tt CLASS=literal>writeObject()</tt> method does 
not need to handle writing the state for the object's superclass 
or any of its subclasses except in the case where the superclass does not 
itself implement the <tt CLASS=literal>Serializable</tt> 
interface. In this case, the nonserializable class must have a no-argument 
constructor that can be called to initialize its fields, and it is the responsibility 
of the subclass to save the state of its superclass. 

<P CLASS=para>
A class that inherits the implementation of <tt CLASS=literal>Serializable</tt> 
prevents itself from being serialized by defining <tt CLASS=literal>readObject()</tt> 
and <tt CLASS=literal>writeObject()</tt> methods that 
throw <tt CLASS=literal>NotSerializableException</tt> 
objects. 

<P CLASS=para>
If a class needs complete control over the contents and formatting of the 
serialized form of its objects, it should implement the <tt CLASS=literal>Externalizable</tt> 
interface. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.285">Class Summary</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public class java.io.ObjectOutputStream extends java.io.OutputStream
             implements java.io.ObjectOutput {
  // Constructors
  public ObjectOutputStream(OutputStream out);
  // Instance Methods
  public void close();
  public final void defaultWriteObject();
  public void flush();
  public void reset();
  public void write(int data);
  public void write(byte[] b);
  public void write(byte[] b, int off, int len);
  public void writeBoolean(boolean data);
  public void writeByte(int data);
  public void writeBytes(String data);
  public void writeChar(int data);
  public void writeChars(String data);
  public void writeDouble(double data);
  public void writeFloat(float data);
  public void writeInt(int data);
  public void writeLong(long data);
  public final void writeObject(Object obj);
  public void writeShort(int data);
  public void writeUTF(String data);
  // Protected Instance Methods
  protected void annotateClass(Class cl);
  protected void drain();
  protected final boolean enableReplaceObject(boolean enable);
  protected Object replaceObject(Object obj);
  protected void writeStreamHeader();
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.286">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.282">ObjectOutputStream</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.353">public ObjectOutputStream(OutputStream out) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>out</tt><br>
<DD>

<P CLASS=para>
The underlying output 
stream. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This constructor creates an <tt CLASS=literal>ObjectOutputStream</tt> 
that writes to the given output stream. The constructor writes the stream 
header, which consists of a magic number and version number, in preparation 
for serialization. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.287">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.283">close</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.354">public void close() throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ObjectOutput.close()</tt> 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>OutputStream.close()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method closes the stream and releases any system resources that are 
associated with it. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.284">defaultWriteObject</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.355">public final void defaultWriteObject() throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NotActiveException</tt><br>
<DD>

<P CLASS=para>
If serialization is not active. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the fields of the object that are not <tt CLASS=literal>static</tt> 
or <tt CLASS=literal>transient</tt>. The method 
can only be called from the <tt CLASS=literal>private</tt> 
<tt CLASS=literal>writeObject()</tt> method of an 
object that is being serialized; it throws a <tt CLASS=literal>NotActiveException</tt> 
if it is called at any other time. This method implements the default serialization 
mechanism. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.285">flush</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.356">public void flush() throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ObjectOutput.flush()</tt> 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>OutputStream.flush()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method takes any buffered output and forces it to be written to the 
underlying stream. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.286">reset</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.357">public void reset() throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method sets the state of the <tt CLASS=literal>ObjectOutputStream</tt> 
to the same state as when it was created. As objects are serialized to 
the stream, the <tt CLASS=literal>ObjectOutputStream</tt> 
remembers which ones are already serialized. If the program requests that 
already serialized objects be written again, the <tt CLASS=literal>ObjectOutputStream</tt> 
just writes out a reference to the previous object. Calling <tt CLASS=literal>reset()</tt> 
causes the <tt CLASS=literal>ObjectOutputStream</tt> 
to forget what it has done before, so all subsequent objects are fully 
serialized. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.287">write</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.358">public void write(int data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ObjectOutput.write(int)</tt> 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>OutputStream.write(int)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the lowest eight bits of <tt CLASS=literal>b</tt> 
to the underlying stream as a <tt CLASS=literal>byte</tt>. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.359">public void write(byte[] b) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>b</tt><br>
<DD>

<P CLASS=para>
An array of bytes to 
write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ObjectOutput.write(byte[])</tt> 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>OutputStream.write(byte[])</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the given array of bytes to the underlying stream. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.360">public void write(byte[] b, int off, int len) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>b</tt><br>
<DD>

<P CLASS=para>
An array of bytes to 
write to the stream.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>off</tt><br>
<DD>

<P CLASS=para>
An offset into the 
byte array.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>len</tt><br>
<DD>

<P CLASS=para>
The number of bytes 
to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ObjectOutput.write(byte[], int, int)</tt> 

<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>OutputStream.write(byte[], int, int)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes <tt CLASS=literal>len</tt> bytes 
from the given array, starting <tt CLASS=literal>off</tt> 
elements from the beginning of the array, to the underlying stream. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.288">writeBoolean</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.361">public void writeBoolean(boolean data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>boolean</tt> 
value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeBoolean()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>data</tt> is <tt CLASS=literal>true</tt>, 
this method writes a byte that contains the value <tt CLASS=literal>1</tt> 
to the underlying stream. If <tt CLASS=literal>data</tt> 
is <tt CLASS=literal>false</tt>, the method writes 
a byte that contains the value 0. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.289">writeByte</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.362">public void writeByte(int data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeByte()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes an 8-bit <tt CLASS=literal>byte</tt> 
to the underlying stream, using the lowest eight bits of the given integer 
<tt CLASS=literal>data</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.290">writeBytes</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.363">public void writeBytes(String data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>String </tt>to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeBytes()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the characters in the given <tt CLASS=literal>String</tt> 
to the underlying stream as a sequence of 8-bit bytes. The high-order 
bytes of the characters in the string are ignored. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.291">writeChar</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.364">public void writeChar(int data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeChar()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes a 16-bit <tt CLASS=literal>char</tt> 
to the underlying stream, using the lowest two bytes of the given integer 
<tt CLASS=literal>data</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.292">writeChars</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.365">public void writeChars(String data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>String </tt>to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeChars()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the characters in the given <tt CLASS=literal>String</tt> 
object to the underlying stream as a sequence of 16-bit characters. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.293">writeDouble</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.366">public void writeDouble(double data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>double</tt> 
value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeDouble()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes a 64-bit <tt CLASS=literal>double</tt> 
to the underlying stream. The <tt CLASS=literal>double</tt> 
value is converted to a <tt CLASS=literal>long</tt> 
using <tt CLASS=literal>doubleToLongBits()</tt> of 
<tt CLASS=literal>Double</tt>; the <tt CLASS=literal>long</tt> 
value is then written to the underlying stream as eight bytes with the 
highest byte first. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.294">writeFloat</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.367">public void writeFloat(float data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>float</tt> 
value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeFloat()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes a 32-bit <tt CLASS=literal>float</tt> 
to the underlying stream. The <tt CLASS=literal>float</tt> 
value is converted to a <tt CLASS=literal>int</tt> 
using <tt CLASS=literal>floatToIntBits()</tt> of <tt CLASS=literal>Float</tt>; 
the <tt CLASS=literal>int</tt> value is then written 
to the underlying stream as four bytes with the highest byte first. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.295">writeInt</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.368">public void writeInt(int data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>int</tt> 
value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeInt()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes a 32-bit <tt CLASS=literal>int</tt> 
to the underlying stream. The value is written as four bytes with the highest 
byte first. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.296">writeLong</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.369">public void writeLong(long data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>long</tt> 
value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeLong()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes a 64-bit <tt CLASS=literal>long</tt> 
to the underlying stream. The value is written as eight bytes with the 
highest byte first. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.297">writeObject</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.370"><DIV CLASS=screen> <P> <PRE> public final void writeObject(Object obj) throws IOException, InvalidClassException, NotSerializableException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>obj</tt><br>
<DD>

<P CLASS=para>
The object to be serialized. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>InvalidClassException</tt><br>
<DD>

<P CLASS=para>
If there is a problem with the class of the object.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>NotSerializableException</tt><br>
<DD>

<P CLASS=para>
If the object does not implement <tt CLASS=literal>Serializable</tt> 
or <tt CLASS=literal>Externalizable</tt>.

<p>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ObjectOutput.writeObject()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method serializes the given object to the stream. The class of the 
object is encoded, along with the class name, the signature of the class, 
the values of the non-<tt CLASS=literal>static</tt> 
and non-<tt CLASS=literal>transient</tt> fields of 
the object, including any other objects referenced by the object (except 
those that do not implement the <tt CLASS=literal>Serializable</tt> 
interface themselves). Multiple references to the same object are encoded 
using a reference sharing mechanism, so that a graph of object can be restored 
appropriately. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.298">writeShort</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.371">public void writeShort(int data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The value to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeShort()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes a 16-bit <tt CLASS=literal>short</tt> 
to the underlying stream, using the lowest two bytes of the given integer 
<tt CLASS=literal>data</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.299">writeUTF</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.372">public void writeUTF(String data) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>data</tt><br>
<DD>

<P CLASS=para>
The <tt CLASS=literal>String</tt> 
to write. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Implements<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>DataOutput.writeUTF()</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the given <tt CLASS=literal>String</tt> 
to the underlying stream using the UTF-8 encoding. See the description 
of <tt CLASS=literal>DataOutputStream.writeUTF(String)</tt> 
for more information. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.288">Protected Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.300">annotateClass</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.373">protected void annotateClass(Class cl) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>cl</tt><br>
<DD>

<P CLASS=para>
The class to be serialized. </DL>
<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method is called once for each unique class during serialization. 
The implementation in <tt CLASS=literal>ObjectOutputStream</tt> 
does nothing; subclasses can override this method to write out more information 
about a class. A corresponding subclass of <tt CLASS=literal>ObjectInputStream</tt> 
should override the <tt CLASS=literal>resolveClass()</tt> 
method to read the extra class information. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.301">drain</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.374">protected void drain() throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method is a helper method for <tt CLASS=literal>flush()</tt>. 
It forces a write of any buffered data in the <tt CLASS=literal>ObjectOutputStream</tt>, 
but does not call <tt CLASS=literal>flush()</tt> on 
the underlying stream. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.302">enableReplaceObject</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.375"><DIV CLASS=screen> <P> <PRE> protected final boolean enableReplaceObject(boolean enable) throws SecurityException </PRE> </DIV></A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>enable</tt><br>
<DD>

<P CLASS=para>
A <tt CLASS=literal>boolean</tt> 
value that specifies whether or not object replacement is enabled. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>true</tt> if object replacement 
was previously enabled; <tt CLASS=literal>false</tt> otherwise. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>SecurityException</tt><br>
<DD>

<P CLASS=para>
If <tt CLASS=literal>enable</tt> is <tt CLASS=literal>true</tt> 
and <tt CLASS=literal>getClassLoader()</tt>called 
on the class of the stream does not return <tt CLASS=literal>null</tt>. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method determines if a trusted subclass of <tt CLASS=literal>ObjectOutputStream</tt> 
is allowed to replace serialized objects. If the method is called with 
<tt CLASS=literal>true</tt>, replacement is enabled. 
Each time an object is serialized, <tt CLASS=literal>replaceObject()</tt> 
is called to give the <tt CLASS=literal>ObjectOutputStream</tt> 
a chance to replace the object. A trusted stream is one whose class has 
no <tt CLASS=literal>ClassLoader</tt>. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.303">replaceObject</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.376">protected Object replaceObject(Object obj) throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>obj</tt><br>
<DD>

<P CLASS=para>
The object to be replaced. </DL>
<p>
<DT CLASS=varlistentry>Returns<br>
<DD>

<P CLASS=para>
A replacement for the given object. 

<p>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
If object replacement is enabled for this <tt CLASS=literal>ObjectOutputStream</tt> 
(see <tt CLASS=literal>enableReplaceObject()</tt>), 
this method is called with each object to be serialized to give the stream 
a chance to replace the object. In <tt CLASS=literal>ObjectOutputStream</tt>, 
this method simply returns the object that was passed to it. Subclasses 
can override this method to provide more useful functionality. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch11-REFSECT2-AUTOID.304">writeStreamHeader</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch11-REFSECT3-AUTOID.377">protected void writeStreamHeader() throws IOException</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Throws<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>IOException</tt><br>
<DD>

<P CLASS=para>
If any kind 
of I/O error occurs. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This method writes the serialization stream header, which consists of a 
magic number and a version number. This method is called by the constructor 
for <tt CLASS=literal>ObjectOutputStream</tt>. If 
you subclass <tt CLASS=literal>ObjectOutputStream</tt>, 
you can override this method to provide your own stream header. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.289">Inherited Methods</A></h2>

<DIV CLASS=informaltable>
<P>
<TABLE CLASS=INFORMALTABLE>
<TR CLASS=row>
<TH ALIGN="left">Method</TH>
<TH ALIGN="left">Inherited From</TH>
<TH ALIGN="left">Method</TH>
<TH ALIGN="left">Inherited From</TH>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>clone()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>equals(Object)</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>finalize()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>getClass()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>hashCode()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>notify()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>notifyAll()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>toString()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>wait()</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>wait(long)</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>wait(long, int)</tt></TD>
<TD ALIGN="left">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="left">&nbsp;</TD>
<TD ALIGN="left">&nbsp;</TD>
</TR>
</TABLE>
<P>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch11-REFSECT1-AUTOID.290">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>Class</tt>, 
<tt CLASS=literal>DataOutput</tt>, 
<tt CLASS=literal>Double</tt>, 
<tt CLASS=literal>Externalizable</tt>, 
<tt CLASS=literal>Float</tt>, 
<tt CLASS=literal>InvalidClassException</tt>, 
<tt CLASS=literal>IOException</tt>, 
<tt CLASS=literal>NotActiveException</tt>, 
<tt CLASS=literal>NotSerializableException</tt>, 
<tt CLASS=literal>ObjectInputStream</tt>, 
<tt CLASS=literal>ObjectOutput</tt>, 
<tt CLASS=literal>OutputStream</tt>, 
<tt CLASS=literal>SecurityException</tt>, 
<tt CLASS=literal>Serializable</tt>, 
<tt CLASS=literal>String</tt> 
</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch11_41.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch11_43.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>ObjectOutput</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>ObjectStreamClass</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
